package com.jhhc.RHDB.Data.Pojo;

import java.util.ArrayList;
import java.util.List;

public class Sensors_PR {

    // 站码
    private String stcd;

    //站名
    private String stnm;


    // 传感器数据
    private List<PRData> sensors;

    public String getStcd() {
        return stcd;
    }

    public void setStcd(String stcd) {
        this.stcd = stcd;
    }

    public String getStnm() {
        return stnm;
    }

    public void setStnm(String stnm) {
        this.stnm = stnm;
    }

    public List<PRData> getSensors() {
        return sensors;
    }

    public void setSensors(List<PRData> sensors) {
        this.sensors = sensors;
    }


    List<PRData> PRData = new ArrayList<>();
    public void setSensors(PRData sensors) {
        this.sensors = PRData;
        PRData.add(sensors);
    }



    public PRData getSensor(String sensor_T) {
        //Sensors sensors=null;
        if (sensors != null){
            for (int i = 0; i < sensors.size(); i++) {
                if (sensors.get(i).getSensorType().toString().equals(sensor_T)) {
                    return sensors.get(i);
                }

            }
        }

        return null;
    }
}
